const express = require('express');
const router = express.Router();
const { formatResponseBody } = require("../utils/tools");
const upload = require("../service/uploadService");

// 引入文件上传中间件
router.post("/", upload.single("file"), (req, res, next) => {
    res.send(formatResponseBody({ data: `/static/uploads/${req.file.filename}` }));
})

module.exports = router;